
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package TweetRay;

import processing.core.PApplet;
import processing.core.PGraphics3D;
import processing.core.PVector;

/**
 *
 *           __
 *          /  \
 *          ^  ^
 *         / \/ \
 *         | .| .|
 *         \_/\_/
 *          |  |
 *          \ o/
 *          /  \
 *         |    |
 *         | | ||
 *         | 0 0|
 *         |    |
 */
public class OmniLight extends Entity implements Light{

    private float radius = 5.f;

    public OmniLight(float tx, float ty, float tz) {
        super(tx, ty, tz);

    }

    public void draw(PGraphics3D p3d) {

        p3d.pushMatrix();
        p3d.fill(255, 255, 255);
        p3d.translate(tx, ty, tz);
        p3d.sphere(radius);
        p3d.popMatrix();


    }

    @Override
    public void pack(UTFWriter output) {
        throw new UnsupportedOperationException("Not supported yet.");
    }


    public void scale(int axis, float amt) {
        radius += amt;
    }


    public Entity copy() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public PVector getSample() {
        PVector offset = CoreFunctions.sampleSphere((float)Math.random(),(float)Math.random());
        offset.mult(radius);
        return new PVector(tx + offset.x,ty + offset.y,tz + offset.z);
    }

    public PVector getNormal() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public float getArea() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void getEmit(PVector in) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void pickDraw(PGraphics3D p3d, int index){
        
    }
    public void setShader(int shaderIndex) {

        this.shaderIndex = shaderIndex;
        

    }

}
